package com.study.bigdata.spark.core.rdd.io

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object Scala02_RDD_IO {
  def main(args: Array[String]): Unit = {

    val conf = new SparkConf().setMaster("local[*]").setAppName("WordCount")
    val sc = new SparkContext(conf)

    val rdd: RDD[(String,Int)] = sc.objectFile("output1")
    rdd.collect().foreach(println)
    /*
    (a,1)
    (b,2)
    (c,3)
     */
    println("-----------------")

    val rdd1: RDD[(String, Int)] = sc.sequenceFile("output2")
    rdd1.collect().foreach(println)
    /*
    (a,1)
    (b,2)
    (c,3)
     */
    sc.stop()

  }


}
